import { Column, Entity, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity('user_task')
export class UserTask {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键id',
  })
  id: number;

  @Column({
    type: 'varchar',
    default: '',
    name: 'task_name',
    comment: '任务名称',
  })
  taskName: string;

  @Column({
    type: 'varchar',
    default: '',
    name: 'task_username',
    comment: '任务发送人',
  })
  taskUserName: string;

  @Column({
    type: 'varchar',
    default: '',
    name: 'note_id',
    comment: '文章id',
  })
  noteId: string;

  @Column({
    type: 'varchar',
    default: '',
    nullable: false,
    length: 50,
    name: 'email',
    comment: '邮箱',
  })
  email: string;

  @Column({
    type: 'varchar',
    length: 100,
    default: '',
    name: 'task_state',
    comment: '任务状态',
  })
  taskState: string;

  @Column({
    type: 'varchar',
    default: '',
    name: 'remarks',
    comment: '备注',
  })
  remarks: string;

  @CreateDateColumn({
    type: 'datetime',
    nullable: false,
    name: 'send_time',
    comment: '发送时间',
  })
  sendTime: Date;

  @CreateDateColumn({
    type: 'datetime',
    nullable: false,
    name: 'create_time',
    comment: '创建时间',
  })
  createTime: Date;
}

export default UserTask;
